
	import {
		mapGetters
	} from 'vuex'
	export const shareMixins = {
		data() {
			return {
				imgUrl:this.$apiFun.imgUrl,
				host:this.$apiFun.host,
				share: {
					title: '',
					desc: '',
					imageUrl: '',
					path: '' 
				},
			}
		},
		computed: {
			...mapGetters([
				'userInfo'
			])
		},
		onShareAppMessage(res) { //发送给朋友
			this.$store.dispatch('setIsShare',true)
			return {
				title: this.share.title,
				desc:this.share.desc,
				imageUrl: this.share.imageUrl,
				path:this.share.path,
			}
		},
		onShareTimeline(res) {//分享到朋友圈
			this.$store.dispatch('setIsShare',true)
			return {
				title: this.share.title,
				desc:this.share.desc,
				imageUrl: this.share.imageUrl,
				path:this.share.path
			}
		},
		onLoad(option) {
			console.log('fenxiang',option)
			// #ifdef MP-WEIXIN
			uni.showShareMenu({
				withShareTicket: true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus: ["shareAppMessage", "shareTimeline"]
			})
			// 设置分享时携带的参数
			if(this.userInfo){
				let id = this.userInfo.id
				this.share.path = '/pages/Tabblock/uni_Home?userId=' + id 
			}
			// #endif
			
		},

		methods: {
		},
		onReachBottom() {
			
		}
	}